package com.grapecc.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 卖糖的兜兜
 * @version 1.0.0
 * @ClassName ApplicationContextConfig.java
 * @Description TODO
 * @createTime 2022年02月04日 21:57:00
 */
@Configuration
public class ApplicationContextConfig {

//    LoadBalanced 负载均衡机制注解 赋予RestTemplate 负载均衡的能力
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }
}
